package com.tovast.demo.controller;

import com.tovast.demo.domain.Attendance;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.experimental.Delegate;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zjp on 2016/9/30.
 */
@Builder
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
public class VAttendance {
    @Delegate
    private Attendance attendance;
    public String getName(){
     return    attendance.getUser().getName();
    }
    public static List<VAttendance> convert(List<Attendance> ats){
        List<VAttendance> vas=new ArrayList<VAttendance>();
        for(Attendance a:ats){
           vas.add(builder().attendance(a).build());
        }
        return vas;
    }
}
